feat(relay): plan-based gating, KV error logging, and request logging#33
Open
iceteaSA wants to merge 3 commits into
Open
feat(relay): plan-based gating, KV error logging, and request logging#33iceteaSA wants to merge 3 commits into
iceteaSA wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
5e33a83 to
693b3db
Compare
f381ba8 to
373871d
Compare
e3cc138 to
2e7467c
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
…ging Worker script improvements: - Plan-based gating: WebSocket transport requires paid plan (RELAY_PLAN=paid) - KV error logging: non-429/403 upstream errors logged to KV with 7-day TTL - Request logging: HTTP and WebSocket requests logged on paid plan - GET health endpoint returns plan info and available transports
…ort to plan The worker gates websocket + logging on RELAY_PLAN, but the CLI never set it, so a worker PUT silently reverted to free-plan behaviour. relaySetup now selects the plan (env or prompt, default free) and passes it through uploadRelayWorker as the RELAY_PLAN binding; transport defaults to websocket for paid, http for free.
b4939fe to
dec18d3
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Relay Worker improvements + a CLI deploy fix so the worker's plan gating actually works.
Worker (
relay.tsWORKER_SCRIPT)RELAY_PLANenv binding:paidenables WebSocket transport + structured logging; otherwise the worker stays HTTP-only (WS upgrades return 403) to fit the free-tier CPU budget.CLI deploy (
cli.ts)relaySetupnow selects the plan —RELAY_PLAN/CLOUDFLARE_PLANenv, else prompt (defaultfree, the safe option for any account) — and passes it through.uploadRelayWorkersets theRELAY_PLANbinding on every deploy. A workerPUTreplaces all bindings, so without this the worker silently reverted to free-plan behaviour on redeploy.transportnow matches the plan (websocketfor paid,httpfor free).Tests
cli.test.tsasserts the relay-setup deploy carries theRELAY_PLANbinding and selects the matching transport.relay-worker-miniflare.test.tscovers the gated worker behaviour.